package com.anyisn.anyflickr.shell.controller
{
	import com.adobe.webapis.flickr.PagedPhotoList;
	import com.anyisn.anyflickr.shell.model.BatchDownloadProxy;
	import com.anyisn.anyflickr.shell.model.PhotoProxy;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	public class PhotoBatchDownloadCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void {
			if(!facade.hasProxy(BatchDownloadProxy.NAME)) {
				facade.registerProxy(new BatchDownloadProxy());
			}
			var bdp:BatchDownloadProxy = facade.retrieveProxy(BatchDownloadProxy.NAME) as BatchDownloadProxy;
			var pl:PagedPhotoList = notification.getBody() as PagedPhotoList;
			bdp.downloadPhotos(pl);
		}
	}
}